<?php

include_once 'model/User.php';
include_once 'BaseView.php';

class MainPageView extends BaseView {
	
	private $user;
	
	public function setData($data) {
		$this->user=new User();
		$this->user=$data;
	}
	
	public function render() {	
		echo '<head><title>'.$this->user->getLogin().'</title></head>';
		echo '<h1> Hello, '.$this->user->getLogin().'!</h1>';
		echo '<img src="avatars/'.$this->user->getAvatar().'" />';
		echo "<form action='index.php?controller=Login&action=index' method='post'>";
		echo "<input type='submit' value='Logout' />";	
		echo "</form>";		
	}
	
}

?>